<template>
  <el-table :data="menuList" style="width: 100%">
    <el-table-column prop="title" label="菜单名称" width="120" />
    <el-table-column prop="url" label="路由路径" width="120" />
    <el-table-column prop="id" label="排序" width="120" />
    <!-- <el-table-column prop="parent_id" label="父id" width="600" /> -->
    <el-table-column fixed="right" label="操作" min-width="120">
      <template #default>
        <el-button link type="primary" size="small" @click="handleClick">删除</el-button>
        <el-button link type="primary" size="small">编辑</el-button>
      </template>
    </el-table-column>
  </el-table>
  <!-- <div>
    <el-switch v-model="value" />
    <hr class="my-4" />
    <el-pagination
      :hide-on-single-page="value"
      :total="4"
      layout="prev, pager, next"
    />
  </div>-->
</template>

<script setup>
import { ref, onMounted } from "vue";
import resquestUnit from "@/api/request.js";
let menuList = ref([]);
onMounted(async () => {
  let res = await resquestUnit.get("management/getMenu/");
  console.log(res);
  menuList.value = res.data.menu_list;
});
const value = ref(false);
const handleClick = () => {
  console.log("click");
};
</script>
